Markaby::Builder.set(:indent, 2)

module Yarbo::Views
  def layout
    xhtml_strict do
      head do 
        title { @title }
        link(:rel => "stylesheet", :type => "text/css", :href => "/themes/yarbo.css")
        link(:rel => "stylesheet", :type => "text/css", :href => "/themes/#{current_theme}/theme.css")
      end
      body do
        self << yield 
      end
    end
  end

  def blog
    div :id => "masthead" do
      h1 @title
      h2 @subtitle
    end
    
    div :id => "posts" do
      @posts.each do |post|
        h1 :id => post.dom_id('title') {post.title}
        div :id => post.dom_id('body') {post.body}
      end
    end
  end
end